@extends('host.common.common')
@section('head')
    <link rel="stylesheet" href="/assets/b2b/css/hougub2b.css">
    <script type="text/javascript" src="/assets/b2b/js/libs/jquery-1.11.3.min.js"></script>
    <script type="text/javascript" src="/assets/b2b/js/libs/underscore-min.js"></script>
    <script type="text/javascript" src="/assets/b2b/js/libs/jquery.paging.min.js"></script>
    <script type="text/javascript" src="/assets/b2b/js/libs/page/template-util.js"></script>
    <script src="/assets/b2b/js/libs/jquery.paging.min.js"></script>
    <script src="/assets/b2b/js/pageModules/common/C13.2.js"></script>
    <script>
        var PAGE_DATA = {
            storeauth: '{{$storeInfo->isGranted()}}',
            cid: '{{$storeInfo->id}}',
            commImg: '/assets/b2b/css/images/storebanner.png',
            pagingObj: {
                total: 0,
                pageSize: 7,
                page: 1
            },
            storeCommNav: [
                {
                    text: '店铺首页',
                    hrefVal: '{{route('store',$storeInfo->id)}}?link=1'
                },
                {
                    text: '公司介绍',
                    hrefVal: '{{route('store.introduce',$storeInfo->id)}}?link=2'
                },
                {
                    text: '招商信息',
                    hrefVal: '{{route('store.canvass',$storeInfo->id)}}?link=3'
                },
                {
                    text: '所有产品',
                    hrefVal: '{{route('store.product',$storeInfo->id)}}?link=4'
                },
                {
                    text: '供应信息',
                    hrefVal: '{{route('store.supply-info',['id'=>$storeInfo->id])}}?link=5'
                }
            ]
        };
    </script>
@stop

@section('body')
    <link rel="stylesheet" href="/assets/b2b/css/common-box.css">

    <!-- top_test -->
    <div id="top_test"></div>

    <!-- web_logo_search -->
    <div id="web_logo_search"></div>

    <!-- comm_nav -->
    <div id="comm_nav"></div>

    <div class="com-w ">
        <div class="shop-homepage">
            <div class="homepage-main-img">
                <img id="comm-top-ad" src=""></div>
            <div id='store-comm-nav' class="homepage-main-title">

            </div>
            <div class="home-page-box clearfix">
                <div class="left-box clearfix fl" style="width: 280px;">
                    <div class="shop-home-left">
                        <div class="homepage-l-title">
                            <div class="f16 ml10 lh40">公司基本信息</div>
                        </div>
                        <div id="company-baseinfo"></div>

                    </div>
                    <div class="store-in-search clearfix">
                        <input type="text" placeholder="搜索">
                        <a href="javascript:void(0)">
                            <span></span>
                        </a>
                    </div>
                    <script type="text/javascript">
                        $(function () {
                            $(".show-hidden").click(function () {
                                var s = $(".tabl-c").css("display");
                                if (s == "none") {
                                    $(".tabl-c").css("display", "block")
                                    $(".bg-add").css("background-position", "-312px -57px")
                                } else {
                                    $(".bg-add").css("background-position", "-291px -55px")
                                    $(".tabl-c").css("display", "none")
                                }
                            });
                        });
                    </script>
                    <div class="shop-home-left shop-home-left2">
                        <div class="homepage-l-title">
                            <div class="f16 ml10 lh40" style="margin-left: 10px;line-height: 40px;">店铺分类</div>
                        </div>
                        <div class="shop-home-left2-m" id="store-classify">
                            {{--<ul class="tabl-tree">--}}
                            {{--<li class="clearfix">--}}
                            {{--<a href="javascript:void(0)" class="show-hidden">--}}
                            {{--<span class="bg-add"></span>--}}
                            {{--<span>全部</span>--}}
                            {{--</a>--}}
                            {{--</li>--}}
                            {{--</ul>--}}
                            {{--<ul class="tabl-c" style="display: none">--}}
                            {{--@foreach ($storeInfo->categories as $category)--}}
                            {{--<li><a href="{{route('store.category',[$storeInfo->id,$category->id])}}">{{$category->name}}</a></li>--}}
                            {{--@endforeach--}}
                            {{--</ul>--}}

                        </div>
                    </div>
                </div>
                @yield('content')
            </div>
        </div>
    </div>


    <!-- foot_nav -->
    <div id="foot_nav"></div>
    <div id="bottom_main"></div>
    <script type="text/template" id="baseinfo-templ">

        <div class="homepage-l-main f16">
            <%=name %></div>
        <div class="homepage-l-logo">
            <img src="<%=logo %>"></div>
        <div class="homepage-l-collection" style="display: none">
            <!-- TODO, 收藏该店铺 -->
            <a href="javascript:void(0)">收藏该店铺</a>
        </div>
        <div class="homepage-l-list">
            <div class="clearfix">
                <div class="l-list-l">店&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;主：</div>
                <div class="l-list-r">
                    <%=storekeeper %></div>
            </div>
            <div class="clearfix">
                <div class="l-list-l">信&nbsp;&nbsp;用&nbsp;&nbsp;度：</div>
                <div class="l-list-r">
                    <%=creditLimit %></div>
            </div>
            <div class="clearfix">
                <div class="l-list-l">店铺等级：</div>
                <div class="l-list-r">
                    <%=storeGrade %>
                </div>
            </div>
            <div class="clearfix">
                <div class="l-list-l">商品数量：</div>
                <div class="l-list-r">
                    <%=goodAmount %></div>
            </div>
            <div class="clearfix">
                <div class="l-list-l">所在地区：</div>
                <div class="l-list-r">
                    <%=region %></div>
            </div>
            <div class="clearfix">
                <div class="l-list-l">创店时间：</div>
                <div class="l-list-r">
                    <%=createTime %></div>
            </div>
            <div class="clearfix">
                <div class="l-list-l">认&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;证：</div>
                <div class="l-list-r">
                    <span title="实名认证"> <img src="<%=certification %>"></span>
                    <span title="供应商认证"> <img src="<%=provider_authentication %>"></span>
                </div>
            </div>
            <div class="clearfix">
                <div class="l-list-l">详细地址：</div>
                <div class="l-list-r">
                    <%=addr %></div>
            </div>
            <div class="clearfix">
                <div class="l-list-l">联系电话：</div>
                <div class="l-list-r">
                    <%=contactPhone %></div>
            </div>
            <div class="clearfix mb10">
                <div class="l-list-l">授权状态：</div>
                <div class="l-list-r" id="login_box" style="height:33px;">
                    <% if(authorityState == "true") { %>
                    已授权
                    <% } else { %>
                    <%=authorityState%>
                    <% } %></div>
            </div>
        </div>

    </script>


    <script type="text/template" id="classify-templ">
        <% _.each(obj, function(item){ %>
        <div>
            <ul class="tabl-tree">
                <li class="clearfix">
                    <a class="show-hidden clearfix" href="javascript:void(0);">
                        <span class="bg-plus icon"></span>
                        <span><%=item.name%></span>
                    </a>
                </li>
            </ul>

            <ul class="tabl-c" style="display: none; margin-top:0px;margin-left:30px;">
                <% _.each(item.children, function(childItem){ %>
                <li>
                    <a class="c-666 f14 h32 lh32" href="<%=childItem.hrefVal%>">
                        <%=childItem.name%></a>
                </li>
                <% }); %></ul>

        </div>
        <% }); %></script>

    <script type="text/javascript">
        $(function () {
            commTemplUtil.initPage();
            //获取登录状态
            var getLogin = COMM_DATA.topObj.loginFlag;
            if (getLogin == "0") {
                $("#login_btn").attr("href", COMM_DATA.topObj.login_href);
            } else {
                var getSq = $("#login_box").attr("code");
                if (getSq == "1") {
                    var login_Val = "<span>已授权</span>";
                    $("#login_box").html(login_Val);
                } else {
                    var login_Val = "<span>未授权</span>,<a href=\" store/{{$storeInfo->id}}/authorization\">点击申请授权</a>";
                    $("#login_box").html(login_Val);
                }

            }
        });
    </script>

@stop

